//
//  EditBabyPhoto.h
//  BabyHelper
//
//  Created by  thomas on 11-8-13.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <UIKit/UIKit.h>
#import "Dao.h"
#import "BabyPhotoEntry.h"
#import "Utility.h"
#import "PhotoManager.h"
#import <Three20/Three20.h>
#import <MapKit/MapKit.h>
#import <MapKit/MKAnnotation.h>
#import <MapKit/MKAnnotationView.h>
#import <Three20/Three20.h>
#import "ListAllPhotoAlbumsView.h"

@interface EditBabyPhotoView : UIViewController <UIActionSheetDelegate,
UIImagePickerControllerDelegate,CLLocationManagerDelegate,MKReverseGeocoderDelegate>{
	UILabel *commentsLabel;
	UILabel *dateLabel;
	UITextField *commentsTextField;
	UIButton *dateButton;	
	UIDatePicker *pickerView;
	NSDateFormatter *dateFormatter; 
	UIImagePickerController   *imgPicker;
	UILabel *albumLabel;
	UIButton *albumButton;
	
	UIView *processingView;
	
	UIButton *picButton;
	UIImageView *pickedImageView;
	BabyPhotoEntry *currentBabyPhotoEntry;
	UIImage*		pickedPhoto;
	UIActionSheet *progressSheet;
	BOOL   photoChanged;
	
	CLLocationManager    *locationManager;
	CLLocation           *startingPoint;
	UILabel				 *locLabel;
	UIButton		     *getLocButton;
	TTActivityLabel* processingLabel;
	
	double    latitude;
	double    longitude;
	NSString  *location;
}


@property (nonatomic,retain) IBOutlet UIView  *processingView;

@property (nonatomic,retain) IBOutlet UILabel *commentsLabel;
@property (nonatomic,retain) IBOutlet UILabel *dateLabel;	
@property (nonatomic,retain) IBOutlet UITextField *commentsTextField;
@property (nonatomic,retain) IBOutlet UILabel *albumLabel;
@property (nonatomic,retain) IBOutlet UIButton *albumButton;	


@property (nonatomic,retain) IBOutlet UIButton *dateButton;	
@property (nonatomic,retain) IBOutlet UIButton *picButton;
@property (nonatomic,retain) IBOutlet UIImageView *pickedImageView;

@property (nonatomic,retain) IBOutlet UIDatePicker *pickerView; 
@property (nonatomic,retain) NSDateFormatter *dateFormatter; 

@property (nonatomic,retain) BabyPhotoEntry *currentBabyPhotoEntry;
@property (nonatomic,retain) IBOutlet UIImagePickerController *imgPicker;
@property (nonatomic,retain) UIImage*		pickedPhoto;
@property (nonatomic,retain) UIActionSheet *progressSheet;
@property (nonatomic) BOOL photoChanged;


@property (retain, nonatomic) CLLocationManager *locationManager;
@property (retain, nonatomic) CLLocation *startingPoint;
@property (nonatomic,retain) IBOutlet UILabel   *locLabel;
@property (nonatomic,retain) IBOutlet UIButton  *getLocButton;
@property (nonatomic,retain) TTActivityLabel    *processingLabel;

@property (nonatomic,retain) NSString  *location;
@property (nonatomic,assign) double  latitude;
@property (nonatomic,assign) double  longitude;



-(IBAction)backgroundTap:(id)sender;

-(void)SaveBabyPhotoEntry;
-(BOOL)DataValidation;

-(IBAction)toggleDateControl:(id)sender;

-(IBAction)toggleChooseAlbum:(id)sender;

-(void)SlideDownDatePicker;

-(IBAction)dateAction:(id)sender;	// when the user has changed the date picke values (m/d/y)

//funcs for load pic from camera or library
-(IBAction)toggleChoosePic:(id)sender;
- (NSArray*)availableMediaTypes:(UIImagePickerControllerSourceType) pickerSourceType;
- (void)setImage:(UIImage*)img movie:(NSURL*)url;
- (BOOL)mediaIsPicked;
- (void)startUploadingOfPickedMediaIfNeed;
- (void)startedReverseGeoderWithLatitude:(double)latitude longitude:(double)longitude;
-(IBAction)toggleGetLoc:(id)sender;

@end
